/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package edu.upn.sigemfi.ope.be;

import java.io.Serializable;
import java.util.List;
import javax.persistence.Basic;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.Id;
import javax.persistence.Lob;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.OneToMany;
import javax.persistence.Table;

/**
 *
 * @author infzt
 */
@Entity
@Table(name = "OPE_MONEDA", catalog = "SIGEMFI", schema = "dbo")
@NamedQueries({@NamedQuery(name = "Moneda.findAll", query = "SELECT m FROM Moneda m"), @NamedQuery(name = "Moneda.findByIdMoneda", query = "SELECT m FROM Moneda m WHERE m.idMoneda = :idMoneda"), @NamedQuery(name = "Moneda.findByDescripcion", query = "SELECT m FROM Moneda m WHERE m.descripcion = :descripcion")})
public class Moneda implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Basic(optional = false)
    @Column(name = "ID_MONEDA", nullable = false)
    private Long idMoneda;
    @Column(name = "DESCRIPCION", length = 50)
    private String descripcion;
    @Lob
    @Column(name = "SIMBOLO")
    private byte[] simbolo;
    @OneToMany(mappedBy = "fidOpeMoneda", fetch = FetchType.LAZY)
    private List<Efectivo> efectivoCollection;
    @OneToMany(mappedBy = "fidOpeMoneda", fetch = FetchType.LAZY)
    private List<TipoCambio> tipoCambioCollection;

    public Moneda() {
    }

    public Moneda(Long idMoneda) {
        this.idMoneda = idMoneda;
    }

    public Long getIdMoneda() {
        return idMoneda;
    }

    public void setIdMoneda(Long idMoneda) {
        this.idMoneda = idMoneda;
    }

    public String getDescripcion() {
        return descripcion;
    }

    public void setDescripcion(String descripcion) {
        this.descripcion = descripcion;
    }

    public byte[] getSimbolo() {
        return simbolo;
    }

    public void setSimbolo(byte[] simbolo) {
        this.simbolo = simbolo;
    }

    public List<Efectivo> getEfectivoCollection() {
        return efectivoCollection;
    }

    public void setEfectivoCollection(List<Efectivo> efectivoCollection) {
        this.efectivoCollection = efectivoCollection;
    }

    public List<TipoCambio> getTipoCambioCollection() {
        return tipoCambioCollection;
    }

    public void setTipoCambioCollection(List<TipoCambio> tipoCambioCollection) {
        this.tipoCambioCollection = tipoCambioCollection;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (idMoneda != null ? idMoneda.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Moneda)) {
            return false;
        }
        Moneda other = (Moneda) object;
        if ((this.idMoneda == null && other.idMoneda != null) || (this.idMoneda != null && !this.idMoneda.equals(other.idMoneda))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "edu.upn.sigemfi.ope.be.Moneda[idMoneda=" + idMoneda + "]";
    }

}
